/**
 * 
 */
package com.williamoneil.charts.client.data;

import java.util.List;

import com.williamoneil.charts.shared.FinancialData;
import com.williamoneil.charts.shared.PeriodicityType;


/**
 * @author gudipati
 * 
 */
public class ChartElementsData {
	private PeriodicityType periodicity = null;
	
	private DateAxis dateAxis = null;
	private PriceAxis priceAxis = null;

	private BenchmarkAxis benchmarkAxis = null;
	
	private List<VerticalGridLine> verticalGridLines = null;
	private List<HorizontalGridLine> horizontalGridLines = null;

	private List<Tick> ticks = null;
	
	private List<FinancialData> financials = null;
	
	/**
	 * @return the periodicity
	 */
	public PeriodicityType getPeriodicity() {
		return periodicity;
	}

	/**
	 * @param periodicity the periodicity to set
	 */
	public void setPeriodicity(PeriodicityType periodicity) {
		this.periodicity = periodicity;
	}

	/**
	 * @return the verticalGridLines
	 */
	public List<VerticalGridLine> getVerticalGridLines() {
		return verticalGridLines;
	}

	/**
	 * @param verticalGridLines the verticalGridLines to set
	 */
	public void setVerticalGridLines(List<VerticalGridLine> verticalGridLines) {
		this.verticalGridLines = verticalGridLines;
	}

	/**
	 * @return the horizontalGridLines
	 */
	public List<HorizontalGridLine> getHorizontalGridLines() {
		return horizontalGridLines;
	}

	/**
	 * @param horizontalGridLines the horizontalGridLines to set
	 */
	public void setHorizontalGridLines(List<HorizontalGridLine> horizontalGridLines) {
		this.horizontalGridLines = horizontalGridLines;
	}

	/**
	 * @return the priceAxis
	 */
	public PriceAxis getPriceAxis() {
		return priceAxis;
	}

	/**
	 * @param priceAxis the priceAxis to set
	 */
	public void setPriceAxis(PriceAxis priceAxis) {
		this.priceAxis = priceAxis;
	}

	/**
	 * @return the dateAxis
	 */
	public DateAxis getDateAxis() {
		return dateAxis;
	}

	/**
	 * @param dateAxis the dateAxis to set
	 */
	public void setDateAxis(DateAxis dateAxis) {
		this.dateAxis = dateAxis;
	}
	/**
	 * @return the ticks
	 */
	public List<Tick> getTicks() {
		return ticks;
	}

	/**
	 * @param ticks the ticks to set
	 */
	public void setTicks(List<Tick> ticks) {
		this.ticks = ticks;
	}
	/**
	 * @return the benchmarkAxis
	 */
	public BenchmarkAxis getBenchmarkAxis() {
		return benchmarkAxis;
	}

	/**
	 * @param benchmarkAxis the benchmarkAxis to set
	 */
	public void setBenchmarkAxis(BenchmarkAxis benchmarkAxis) {
		this.benchmarkAxis = benchmarkAxis;
	}
	
	/**
	 * @return the financials
	 */
	public List<FinancialData> getFinancials() {
		return financials;
	}

	/**
	 * @param financials the financials to set
	 */
	public void setFinancials(List<FinancialData> financials) {
		this.financials = financials;
	}

	
	public Tick getTickAtPoint(final int x) {
		if(ticks == null) {
			return null;
		}
		
		return dateAxis.getTickAtX(x);
	}

}
